home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / T-Z / XCMDInfo.cpt / CFlash.c next >
Text File  |  1989-02-26  |  2KB  |  63 lines

  1. /*
  2.     CFlash -- a sample HyperCard user-defined command in C.
  3.     ©Apple Computer, Inc. 1987
  4.     All Rights Reserved.
  5.  
  6.     To compile and link this file using Macintosh Programmer's Workshop,
  7.  
  8.     C -q2 Cflash.c
  9.     link -sn Main=Cflash -sn STDIO=Cflash ∂
  10.          -sn INTENV=Cflash -rt XCMD=5 ∂
  11.          Cflash.c.o -o HyperCommands 
  12.          
  13.     If your program user parts of the C Library, use this link instead:
  14.     
  15.     link -sn Main=Cflash -sn STDIO=Cflash ∂
  16.          -sn INTENV=Cflash -rt XCMD=5 ∂
  17.          -m CFLASH Cflash.c.o "{CLibraries}"CRuntime.o ∂
  18.          "{CLibraries}"CInterface.o ∂
  19.          -o HyperCommands
  20.  
  21.     This link directive puts the XCMD in the file "HyperCommands".
  22.     Substitute the name of the stack you want it in.  To move XCMDs
  23.     between stacks, use ResEdit.  They can be in an individual stack,
  24.     the Home stack, the HyperCard application, or the System File.
  25.     
  26.     (XCMD=0 for flash from Pascal, =5 for cFlash from C)
  27.     (XCMD=11 Panasonic, =12 Hitachi, =13 Phillips, =14 PioneerLDV6000,
  28.     =15 PioneerLVP4200, =20 SoundCapToRes)
  29. */
  30.  
  31. #include <Types.h>
  32. #include <Memory.h>
  33. #include <OSUtils.h>
  34. #include <QuickDraw.h>
  35. #include <HyperXCmd.h>
  36. pascal    void    Debugger()    extern 0xA9FF;   
  37.  
  38. /* **** WARNING:  DO NOT USE GLOBAL VARIABLES! **** */
  39.  
  40. pascal void CFlash(paramPtr)
  41.     XCmdBlockPtr    paramPtr;
  42. {
  43.     short    flashCount,again;
  44.     GrafPtr    port;
  45.     Str255    str;
  46.  
  47.     /* First param is flash count.  Convert it to a pascal string */
  48.     ZeroToPas(paramPtr,*(paramPtr->params[0]),&str);
  49.     /* Convert the string to a number */
  50.     flashCount = StrToNum(paramPtr,&str);
  51.     GetPort(&port);
  52.     for (again = 1; again <= flashCount; again++)
  53.         {
  54.             InvertRect(&port->portRect);
  55.             InvertRect(&port->portRect);
  56.         }
  57. }
  58.  
  59. /* C routines for HyperCard callbacks */
  60. #include <XCmdGlue.inc.c>
  61.  
  62.  
  63.